__author__ = 'Dianlei Zhang'


import urllib.request
import urllib

url = "http://www.csdn.net/"
myHeader = {
    'Connection': 'Keep-Alive',
    'Accept': 'text/html, application/xhtml+xml, */*',
    'Accept-Language': 'en-US,en;q=0.8,zh-Hans-CN;q=0.5,zh-Hans;q=0.3',
    'User-Agent': 'Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko'
}

req = urllib.request.Request(url, headers=myHeader)
data = urllib.request.urlopen(req).read().decode('utf-8')
# data = urllib.request.urlopen(url).read().decode('utf-8')

# data = data.decode("UTF-8")

print(data)

